package com.prj.ufdm.cloud.ms.core.enums;

/**
 * 编码生成枚举
 * @author 郑仔祥
 *
 */
public enum CodeGenerateEnum {
	
	ENT_CODE_GENERATE("10000","ENT_CODE"),//企业编码生成
	ORGAN_CODE_GENERATE("10000","ORGAN_CODE"),//机构编码生成
	PROJ_CODE_GENERATE("10000","PROJ_CODE"),//项目编码
	USER_CODE_GENERATE("10000","USER_CODE"),//用户编码
	ROLE_CODE_GENERATE("10000","ROLE_CODE"),//角色编码
	MATE_CODE_GENERATE("10000","MATE_CODE")	//资料编码，
	;
	private String code;
	private String message;
	
	CodeGenerateEnum(String code,String message){
		this.code = code;
		this.message = message;
	}

	/**
	 * 根据值获取名称
	 * @param retCode
	 * @return
	 */
	public static String getRetMessage(String retCode){
		String rtnRetCode = "";
		for (CodeGenerateEnum codeGenerate : CodeGenerateEnum.values()) {
			if(codeGenerate.code.equals(retCode)){
				rtnRetCode = codeGenerate.message;
			}
	    }
		return rtnRetCode;
	}
	
	/**
	 * 
	 * 根据名称获取值
	 * @param retMessage
	 * @return
	 */
	public static String getRetValue(String retMessage){
		String rtnRetCode = "";
		for (CodeGenerateEnum codeGenerate : CodeGenerateEnum.values()) {
			if(codeGenerate.message.equals(retMessage)){
				rtnRetCode = codeGenerate.code;
			}
	    }
		return rtnRetCode;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

}
